home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 6
/
FM Towns Free Software Collection 6.iso
/
t_os
/
speak
/
src
/
speak.bas
< prev
Wrap
BASIC Source File
|
1993-07-08
|
3KB
|
75 lines
1000 '==============================================================
1010 ' 簡易ボイスシンセサイザ おしゃべり小僧
1020 '==============================================================
1030 DEFINT A-Z
1040 DIM FACE(20000),KOE(1008),KAZU$(10),ALPHA$(26)
1050 SCREEN @0:CONSOLE 2,22,2
1060 GOSUB *顔を描く:GOSUB *英数字
1070 PUT@A(400,0)-(599,199),FACE
1080 LOCATE 0,0:PRINT "*** おしゃべり小僧 ***":LOCATE 0,2
1090 '
2000 '--------------------------------------------------------------
2010 ' メインルーチン
2020 '--------------------------------------------------------------
2030 *MAIN
2040 LINE INPUT"入力:",SPK$
2050 IF SPK$="" THEN *BYE
2060 GOSUB *おしゃべり
2070 GOTO *MAIN
2080 '
2090 *BYE
2100 END
2110 '
10000 '--------------------------------------------------------------
10010 ' ぱくぱく おしゃべりサブルーチン
10020 '--------------------------------------------------------------
10030 *おしゃべり
10040 SPK0$=AKCNV$(SPK$)
10050 CNT=KLEN(SPK0$):I=1
10060 WHILE I<=CNT
10070 M$=KMID$(SPK0$,I,1)
10080 IF M$>="ァ" AND M$<="ヴ" THEN MID$(SPK0$,I*2-1,2)=KNJ$(JIS(M$)-&H100)
10090 IF M$>="0" AND M$<="9" THEN SPK0$=KLEFT$(SPK0$,I-1)+KAZU$(VAL(KACNV$(M$)))+KRIGHT$(SPK0$,KLEN(SPK0$)-I)
10100 IF M$>="a" AND M$<="z" THEN M$=KNJ$(JIS(M$)-&H20)
10110 IF M$>="A" AND M$<="Z" THEN SPK0$=KLEFT$(SPK0$,I-1)+ALPHA$(JIS(M$)-JIS("A"))+KRIGHT$(SPK0$,KLEN(SPK0$)-I)
10120 CNT=KLEN(SPK0$):I=I+1
10130 WEND
10140 '
10150 FOR I=1 TO KLEN(SPK0$)
10160 M$=KMID$(SPK0$,I,1)
10170 LOAD@ M$+".snd",KOE%
10180 PUT@A(400,0)-(599,199),FACE,,,,,10000
10190 PCMPLAY KOE%,127:WAIT 5 'ハードディスクで動かすときにはwait 20
10200 PUT@A(400,0)-(599,199),FACE
10210 NEXT
10220 RETURN
10230 '
10240 '--------------------------------------------------------------
10250 ' 準備
10260 '--------------------------------------------------------------
10270 *顔を描く
10280 GOSUB *FACE1:GET@A(0,0)-(199,199),FACE
10290 GOSUB *FACE2:GET@A(0,0)-(199,199),FACE,10000
10300 CLS
10310 RETURN
10320 *FACE1
10330 LINE(0,0)-(199,199),PSET,7,BF
10340 DEF PEN 0,8:CIRCLE(100,100),90,0,,,,F,,6:CIRCLE(100,130),20,0,,.125!,.375!
10350 DEF PEN 0,16:PSET(135,80),0:PSET(65,80),0
10360 RETURN
10370 *FACE2
10380 LINE(0,0)-(199,199),PSET,7,BF
10390 DEF PEN 0,8:CIRCLE(100,100),90,0,,,,F,,6:CIRCLE(100,140),20,0,.5!,,,F,,7
10400 DEF PEN 0,16:PSET(135,80),0:PSET(65,80),0
10410 RETURN
10420 '
10430 *英数字
10440 RESTORE 10480
10450 FOR I=0 TO 9:READ KAZU$(I):NEXT
10460 FOR I=0 TO 25:READ ALPHA$(I):NEXT
10470 RETURN
10480 DATA ぜろ,いち,に,さん,し,ご,ろく,しち,はち,きゅう
10490 DATA えい,びい,しい,でえ,いい,えふ,じい,えいち,あい,じえい,けい,える
10500 DATA えむ,えぬ,おお,ぴい,きゆう,あある,えす,てい,ゆう,い,だぶりゆ
10510 DATA えくす,わい,ずい